package plantsVSzombies;

public abstract class Zombies {
	
	public abstract String getName();

	public abstract int getHp();

	public abstract void setHp(int hp);

	public abstract int getAtk();

	public abstract void setAtk(int atk);

	public Zombies() {
		System.out.println("===============================");
		System.out.print("僵尸方派出了"+this.getName());
	}
	
	public void attackPlants(Plants p) {
		System.out.print(this.getName()+"对植物  " + p.getName() + " 造成了 " + this.getAtk() + " 点伤害");
		p.setHp(p.getHp() - this.getAtk());
		if (p.getHp() > 0) {
			System.out.println("    植物"+p.getName()+"还有血量: " + p.getHp());
		}
		else {
			System.out.println("    植物"+p.getName()+"已死亡");
		}
	}

}
